decorative banner

Accessing specific values in a vector or array


    You can create an expression that references just one value within the array of a 2D or 3D property. By default, the first value is used, unless you specify otherwise. For example, if you drag the pick whip from layer 1's Rotation property to layer 2's Scale property, the following expression appears:

    this_comp.layer(2).scale[0]

    By default, the above expression uses the first value of the Scale property, which is width. If you prefer to use the height value instead, drag the pick whip directly to the second value instead of the property name, or change the expression as follows:

    this_comp.layer(2).scale[1]

    Conversely, if you drag the pick whip from layer 2's Scale property to layer 1's Rotation property, After Effects automatically duplicates the expression so that two values are available for the scale. The following expression appears:

    [this_comp.layer(1).rotation, this_comp.layer(1).rotation]

    To use a different value as one of the value parameters instead of doubling the one rotation value, remove the duplicate expression and insert a value. For example, to use the rotation value for the scale's height and 10 for the width, use the following expression:

    [this_comp.layer(1).rotation, 10]